package com.ghxxzx.dagl.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ghxxzx.dagl.entity.RoleMenue;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface RoleMenueMapper extends BaseMapper<RoleMenue> {
    @Select("select DISTINCT rm.role_id,rm.menue_id from role_menue rm WHERE rm.role_id in (#{id})")
    List<RoleMenue> findRoleIdAll(@Param("id") Integer id);

    @Delete("delete from role_menue WHERE role_id = #{id}")
    void deleteByRoleId(@Param("id") Integer id);

    @Select("select DISTINCT rm.role_id,rm.menue_id from role_menue rm WHERE rm.role_id = #{id}")
    List<RoleMenue> selectByRoleId(@Param("id") Integer id);

}
